home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
mint
/
lib
/
mntlib44.zoo
/
mntlib
/
purec
/
Makefile
< prev
next >
Wrap
Makefile
|
1994-03-01
|
18KB
|
632 lines
### Makefile for MiNT Library for Pure C and Turbo C
### hohmuth 19 Feb 1993
###
### This makefile needs GNU make.
###
### This makefile is pretty tough.. Make sure your make has a large stack!
### (The MiNT library's standard stack size (8K) is _not_ enough!)
###
### begin of configuration section
###
# TURBOC= yes if you still use Turbo C.
# If you do so, I strongly suggest upgrading to Pure C.
# Comment this out if you use Pure C.
#TURBOC= yes
# COMPILERDIR= the main directory of your Turbo/Pure C installation
# As file names in rules may not contain colons (`:'), this path
# name should _not_ contain a TOS-style drive specification (like "c:").
# If you define TOSIFY_COMMANDS below, this path will be automatically
# tosified.
#COMPILERDIR= /dev/g/turboc
COMPILERDIR= /dev/d/pc
# BINDIR= where your compiler's tools (pcc.ttp, plink.ttp etc.) reside
#BINDIR= $(COMPILERDIR)
BINDIR= $(COMPILERDIR)/bin
# LIBDIR= where to search for the compiler's libraries. Some of them are
# linked into the MiNT library.
LIBDIR= $(COMPILERDIR)/lib
# COMPILERINCDIR= where to find your compiler's includes, especially
# float.h and math.h.
# This is only needed during "make install-includes".
COMPILERINCDIR= $(COMPILERDIR)/include
# INCLUDEDIR= where your MiNT library's include files (mntinc) reside.
# If you define TOSIFY_NAMES below, this is path will be automatically
# tosified for the compiler's -I switch.
INCLUDEDIR= /dev/z/src/lib/include
# OSBINDLIB= the location of the osbind library by Ole Arndt und
# Ulf Moeller, if you have it. This library replaces our TOS bindings.
# If you use Turbo C, and don't have `awk', you _should_ get this library.
# If you don't have it, you need to have `awk'. (we need to hack our
# TOS bindings)
# For Pure C users: You don't need to have this library.
# Comment this out, if you don't have the osbind library.
#OSBINDLIB= $(LIBDIR)/osbind.lib
# INSTALLDIR= the directory you want to have the MiNT library installed to.
# This is only needed during "make install".
INSTALLDIR= $(LIBDIR)
# COMMONDIR= where the main bulk of the library source resides
COMMONDIR= ..
# ASSERTIONS= yes if you want to activate the library's calls to assert().
# Comment this out if you don't.
#ASSERTIONS= yes
# DEBUGINFO= yes, if you want your libraries created with debug info.
# Comment this out if you don't.
#DEBUGINFO= yes
# PCREL= yes, if you want all sub-routine calls to be PC relative.
# This can cause problems with bigger projects, however.
# Comment this out if you prefer absolute calls to sub-routines.
#PCREL= yes
# TOSIFY_NAMES= yes if the compiler's tools (pcc, plink etc.) don't
# understand Unix-like path names.
# Comment this out if your compiler _does_ understand names like "/dev/c/foo".
TOSIFY_NAMES= yes
# TOSIFY_COMMANDS= yes if your shell (see SHELL below) wants path names
# in TOS form (i.e. does not understand unix compatible file names like
# "/dev/c/foo"). Mupfel wants this.
# Comment this out if your shell groks names like "/dev/c/foo".
# NOTE: your versions of rm, cp, etc. _should_ understand
# unix-like names
#TOSIFY_COMMANDS= yes
# sh_backslash= the string that should be passed to the shell as a single
# backslash character. This depends on your shell (whether your
# shell needs backslashes escaped with another backslash, as do most
# unix-like shells). On contrast, Mupfel wants only one backslash, as well
# as the shell that comes with `elvis'.
sh_backslash= \\
#sh_backslash= \$(nothing)
# SHELL, RM, CP, INSTALL_DATA, AWK, ECHO: edit to suite your taste
# These programs _should_ understand unix-like path names (like "/dev/c/foo").
# INSTALL_DATA is only needed during "make install" and "make install-includes".
# AWK is only needed when using Turbo C without the osbind library (see
# explanation on OSBINDLIB above)
# ECHO is only needed with Turbo C.
#
# all of these programs should understand the ARGV scheme.
SHELL= /bin/sh # a bourne shell
#SHELL= /usr/local/bin/bash # GNU bash
#SHELL= c:/usr/gemini/1.89/mupfel.ttp # Mupfel 1.89 (don't try 1.21)
#SHELL= c:/bin/shell.ttp # simple shell (from `elvis' distribution)
#SHELL= # no shell at all (works only with Pure C)
RM= rm
CP= cp
AWK= awk
ECHO= echo
INSTALL_DATA= cp
#INSTALL_DATA= install -m 644
###
### end of configuration section
###
### the compiler programs, and what flags they need
ifdef TOSIFY_NAMES
DIRSEP= $(sh_backslash)
else
DIRSEP= /
endif
ifdef TURBOC
CC := $(BINDIR)/tcc.ttp -W
AS := $(BINDIR)/mas.ttp
LD := $(BINDIR)/tlink.ttp
else
CC := $(BINDIR)/pcc.ttp -W
AS := $(BINDIR)/pasm.ttp
LD := $(BINDIR)/plink.ttp
endif
ifdef TOSIFY_COMMANDS
tosify_name := $(CC)
include tosify.mak
CC := $(tosify_name)
tosify_name := $(AS)
include tosify.mak
AS := $(tosify_name)
tosify_name := $(LD)
include tosify.mak
LD := $(tosify_name)
endif
ifdef DEBUGINFO
CCSYMFLAGS= -Y
ifdef TURBOC
ASSYMFLAGS=
else
ASSYMFLAGS= -Y
endif
LDSYMFLAGS= -G -L -Y
else
CCSYMFLAGS=
ASSYMFLAGS=
LDSYMFLAGS= -G
endif
ifdef PCREL
CCRELFLAGS=
else
CCRELFLAGS= -P
endif
MAKEOBJ= -J
ifdef ASSERTIONS
CCDEBUGDEFS=
else
CCDEBUGDEFS= -DNDEBUG
endif
INCSPEC := $(INCLUDEDIR)
# tosify the include specification
ifdef TOSIFY_NAMES
tosify_name := $(INCSPEC)
include tosify.mak
INCSPEC := $(tosify_name)
endif
CCINCFLAGS= -I$(INCSPEC)
# with Turbo C, we need to work around its missing ARGV capability
ifdef TURBOC
ARGV_WORKAROUND= yes
else
ARGV_WORKAROUND=
endif
### default flags to compiler, linker, assembler
CCFLAGS= $(CCINCFLAGS) $(CCSYMFLAGS) $(CCRELFLAGS) $(CCDEBUGDEFS)
ASFLAGS= $(ASSYMFLAGS)
LDFLAGS= $(LDSYMFLAGS)
### what to build
MINTLIB= mintlib.lib
MATHLIB= mintflt.lib
FPUMATHLIB= mint881.lib
STARTUPOBJ= crt0.o
ALLOCAOBJ= alloca.o
FPUALLOCAOBJ= falloca.o
MYTOSLIB= myosbind.lib
DIST_MATHLIB= d_flt.lib
DIST_FPUMATHLIB= d_881.lib
ifdef TURBOC
ALL= $(MINTLIB) $(MATHLIB) $(STARTUPOBJ) $(ALLOCAOBJ)
BINDIST= $(MINTLIB) $(DIST_MATHLIB) $(STARTUPOBJ) $(ALLOCAOBJ)
else
ALL= $(MINTLIB) $(MATHLIB) $(STARTUPOBJ) $(ALLOCAOBJ) \
$(FPUMATHLIB) $(FPUALLOCAOBJ)
BINDIST= $(MINTLIB) $(DIST_MATHLIB) $(STARTUPOBJ) $(ALLOCAOBJ) \
$(DIST_FPUMATHLIB) $(FPUALLOCAOBJ)
endif
.PHONY: all
all: $(ALL)
.PHONY: bindist
bindist: $(BINDIST)
### things we link from the compiler's distribution
ifdef TURBOC
CCFLOATLIB := $(LIBDIR)/tcfltlib.lib
else
CCFLOATLIB := $(LIBDIR)/pcfltlib.lib
CC881LIB := $(LIBDIR)/pc881lib.lib
endif
CCFLOATLIBSPEC := $(CCFLOATLIB)
CC881LIBSPEC := $(CC881LIB)
# tosify the library specifications, if nessecary
ifdef TOSIFY_NAMES
tosify_name := $(CCFLOATLIBSPEC)
include tosify.mak
CCFLOATLIBSPEC := $(tosify_name)
tosify_name := $(CC881LIBSPEC)
include tosify.mak
CC881LIBSPEC := $(tosify_name)
endif
### which OS bindings library to link
BUILD_MYTOSLIB_DEP :=
# the osbind library replaces our tos library.
ifdef OSBINDLIB
TOSLIB := $(OSBINDLIB)
else
ifdef TURBOC
TOSLIB := $(MYTOSLIB)
# used as a file dependency for $(MINTLIB)
BUILD_MYTOSLIB_DEP := $(MYTOSLIB)
else
TOSLIB :=
endif
endif
TOSLIBSPEC := $(TOSLIB)
# tosify the library specification, if nessecary
ifdef TOSIFY_NAMES
tosify_name := $(TOSLIBSPEC)
include tosify.mak
TOSLIBSPEC := $(tosify_name)
endif
### how to build MINTLIB
COMMONSRC := a64l.c abort.c abs.c access.c alarm.c alphasor.c atexit.c \
atoi.c atol.c bblink.c bcmp.c binmode.c bsearch.c calloc.c \
cfgetisp.c cfgetosp.c cfsetisp.c cfsetosp.c chdir.c \
chmod.c chown.c clock.c close.c closedir.c console.c crtinit.c ctermid.c \
ctime.c ctype.c defmode.c \
doprnt.c do_lock.c do_stat.c dup.c dup2.c eprintf.c \
execl.c execle.c execp.c execv.c execve.c \
fclose.c fcntl.c fdopen.c fflush.c \
fgetc.c fgetpos.c fgets.c filbuf.c findfile.c flock.c fopen.c \
fopen_i.